package fun.easycode.jointblock.service.dto.data;

import fun.easycode.jointblock.datafill.DataFill;
import fun.easycode.jointblock.datafill.DataParam;
import fun.easycode.jointblock.datafill.EnableDataFill;
import fun.easycode.jointblock.manager.*;
import lombok.Data;

import java.util.List;

@Data
@EnableDataFill
public class ArticlePagingDto {
    private String id;
    private String title;
    private String content;
    private List<String> sourceCoverImg;
    private List<String> coverImg;
    private List<String> img;
    private List<String> coverImgSmall;
    // , methodName = "getUserByIds"
    @DataFill(source = UserClient.class, value = "userId")
    private UserBaseDto user;
    @DataFill(source = CollegeClient.class)
    private CollegeDto college;
    private Long createTime;
    @DataFill(source = PraiseCountClient.class)
    private int praiseCount;
    @DataFill(source = CommentCountClient.class, params = {
            @DataParam(
                    name = "topicIds",
                    value = "#ids"
            )
    })
    private int commentCount;
    @DataFill(source = BroweCountClient.class
            , spEl = "#source.playAmount + #source.virtualPlayAmount")
    private int browseCount;
    @DataFill(source = PraiseClient.class, params = {
            @DataParam(
                    name = "userId",
                    value = "T(fun.easycode.jointblock.common.util.SecurityUtil).getCurrentUserId()"
            ),
            @DataParam(
                    name = "topicIds",
                    value = "#ids"
            )
    })
    private Boolean isPraise = false;
    private Boolean isAttention = false;
    @DataFill(source = FavoriteClient.class, params = {
            @DataParam(
                    name = "userId",
                    value = "T(fun.easycode.jointblock.common.util.SecurityUtil).getCurrentUserId()"
            ),
            @DataParam(
                    name = "topicIds",
                    value = "#ids"
            )
    })
    private Boolean isCollection = false;
    private String topicType = TopicType.ARTICLE.getValue();
    private String type = WorkType.TEXT.getValue();
    private List<LabelBeanDto> labels;
    private String publishStatus;
    private String operatorId;
    private String humanReviewStatus;
}
